package sudroid.android.context;

import android.content.Context;
import android.graphics.Bitmap;
import android.os.Handler;
import android.os.Looper;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import java.util.Iterator;
import java.util.Set;
import java.util.WeakHashMap;
import sudroid.LogUtils;

public abstract class SetAdapter<T extends Comparable<T>> extends BaseAdapter
{
  private Set<T> backgroundDatas;
  protected Set<T> frontDatas;
  protected WeakHashMap<String, Bitmap> frontImages;
  private Object lock;
  private Class<? extends Set<T>> mClass;
  private Context mContext;
  private Handler uiHandler;

  public SetAdapter(Context paramContext, Class<? extends Set<T>> paramClass)
    throws IllegalAccessException, InstantiationException
  {
    WeakHashMap localWeakHashMap = new WeakHashMap(128);
    this.frontImages = localWeakHashMap;
    Object localObject = new Object();
    this.lock = localObject;
    this.mContext = paramContext;
    Looper localLooper = paramContext.getMainLooper();
    Handler localHandler = new Handler(localLooper);
    this.uiHandler = localHandler;
    this.mClass = paramClass;
    Set localSet = (Set)paramClass.newInstance();
    this.frontDatas = localSet;
  }

  public void close()
  {
    this.frontImages.clear();
    if (this.frontDatas != null)
      this.frontDatas.clear();
    if (this.backgroundDatas != null)
      this.backgroundDatas.clear();
  }

  // ERROR //
  public final void complement(long paramLong)
  {
    // Byte code:
    //   0: aload_0
    //   1: invokevirtual 89	sudroid/android/context/SetAdapter:initBackgroundDatas	()Ljava/util/Set;
    //   4: astore_3
    //   5: aload_0
    //   6: lload_1
    //   7: aload_3
    //   8: invokevirtual 93	sudroid/android/context/SetAdapter:prepareExtraDatas	(JLjava/util/Set;)Z
    //   11: ifeq +53 -> 64
    //   14: aload_0
    //   15: getfield 43	sudroid/android/context/SetAdapter:lock	Ljava/lang/Object;
    //   18: astore 4
    //   20: aload 4
    //   22: monitorenter
    //   23: aload_0
    //   24: getfield 76	sudroid/android/context/SetAdapter:backgroundDatas	Ljava/util/Set;
    //   27: invokeinterface 97 1 0
    //   32: ifgt +33 -> 65
    //   35: aload_0
    //   36: getfield 58	sudroid/android/context/SetAdapter:uiHandler	Landroid/os/Handler;
    //   39: astore 5
    //   41: new 99	sudroid/android/context/SetAdapter$9
    //   44: dup
    //   45: aload_0
    //   46: lload_1
    //   47: invokespecial 102	sudroid/android/context/SetAdapter$9:<init>	(Lsudroid/android/context/SetAdapter;J)V
    //   50: astore 6
    //   52: aload 5
    //   54: aload 6
    //   56: invokevirtual 106	android/os/Handler:postAtFrontOfQueue	(Ljava/lang/Runnable;)Z
    //   59: istore 7
    //   61: aload 4
    //   63: monitorexit
    //   64: return
    //   65: aload_0
    //   66: getfield 70	sudroid/android/context/SetAdapter:frontDatas	Ljava/util/Set;
    //   69: astore 8
    //   71: aload_0
    //   72: getfield 76	sudroid/android/context/SetAdapter:backgroundDatas	Ljava/util/Set;
    //   75: astore 9
    //   77: aload 8
    //   79: aload 9
    //   81: invokestatic 111	sudroid/SetUtil:complement	(Ljava/util/Set;Ljava/util/Set;)Ljava/util/Set;
    //   84: checkcast 113	java/util/HashSet
    //   87: astore 10
    //   89: aload_0
    //   90: aload 10
    //   92: putfield 70	sudroid/android/context/SetAdapter:frontDatas	Ljava/util/Set;
    //   95: aload_0
    //   96: getfield 58	sudroid/android/context/SetAdapter:uiHandler	Landroid/os/Handler;
    //   99: astore 11
    //   101: new 115	sudroid/android/context/SetAdapter$10
    //   104: dup
    //   105: aload_0
    //   106: lload_1
    //   107: invokespecial 116	sudroid/android/context/SetAdapter$10:<init>	(Lsudroid/android/context/SetAdapter;J)V
    //   110: astore 12
    //   112: aload 11
    //   114: aload 12
    //   116: invokevirtual 106	android/os/Handler:postAtFrontOfQueue	(Ljava/lang/Runnable;)Z
    //   119: istore 13
    //   121: goto -60 -> 61
    //   124: astore 14
    //   126: aload 4
    //   128: monitorexit
    //   129: aload 14
    //   131: athrow
    //   132: invokestatic 122	sudroid/LogUtils:e	(Ljava/lang/Throwable;)V
    //   135: goto -71 -> 64
    //   138: invokestatic 122	sudroid/LogUtils:e	(Ljava/lang/Throwable;)V
    //   141: goto -77 -> 64
    //
    // Exception table:
    //   from	to	target	type
    //   23	124	124	finally
    //   0	23	132	java/lang/IllegalAccessException
    //   129	132	132	java/lang/IllegalAccessException
    //   0	23	138	java/lang/InstantiationException
    //   129	132	138	java/lang/InstantiationException
  }

  // ERROR //
  public final void differenceBackground(long paramLong)
  {
    // Byte code:
    //   0: aload_0
    //   1: invokevirtual 89	sudroid/android/context/SetAdapter:initBackgroundDatas	()Ljava/util/Set;
    //   4: astore_3
    //   5: aload_0
    //   6: lload_1
    //   7: aload_3
    //   8: invokevirtual 93	sudroid/android/context/SetAdapter:prepareExtraDatas	(JLjava/util/Set;)Z
    //   11: ifeq +50 -> 61
    //   14: aload_0
    //   15: getfield 43	sudroid/android/context/SetAdapter:lock	Ljava/lang/Object;
    //   18: astore_3
    //   19: aload_3
    //   20: monitorenter
    //   21: aload_0
    //   22: getfield 76	sudroid/android/context/SetAdapter:backgroundDatas	Ljava/util/Set;
    //   25: invokeinterface 97 1 0
    //   30: ifgt +32 -> 62
    //   33: aload_0
    //   34: getfield 58	sudroid/android/context/SetAdapter:uiHandler	Landroid/os/Handler;
    //   37: astore 4
    //   39: new 125	sudroid/android/context/SetAdapter$6
    //   42: dup
    //   43: aload_0
    //   44: lload_1
    //   45: invokespecial 126	sudroid/android/context/SetAdapter$6:<init>	(Lsudroid/android/context/SetAdapter;J)V
    //   48: astore 5
    //   50: aload 4
    //   52: aload 5
    //   54: invokevirtual 106	android/os/Handler:postAtFrontOfQueue	(Ljava/lang/Runnable;)Z
    //   57: istore 6
    //   59: aload_3
    //   60: monitorexit
    //   61: return
    //   62: aload_0
    //   63: getfield 70	sudroid/android/context/SetAdapter:frontDatas	Ljava/util/Set;
    //   66: astore 7
    //   68: aload_0
    //   69: getfield 76	sudroid/android/context/SetAdapter:backgroundDatas	Ljava/util/Set;
    //   72: astore 8
    //   74: aload 7
    //   76: aload 8
    //   78: invokeinterface 130 2 0
    //   83: istore 9
    //   85: aload_0
    //   86: getfield 58	sudroid/android/context/SetAdapter:uiHandler	Landroid/os/Handler;
    //   89: astore 10
    //   91: new 132	sudroid/android/context/SetAdapter$7
    //   94: dup
    //   95: aload_0
    //   96: lload_1
    //   97: invokespecial 133	sudroid/android/context/SetAdapter$7:<init>	(Lsudroid/android/context/SetAdapter;J)V
    //   100: astore 11
    //   102: aload 10
    //   104: aload 11
    //   106: invokevirtual 106	android/os/Handler:postAtFrontOfQueue	(Ljava/lang/Runnable;)Z
    //   109: istore 12
    //   111: goto -52 -> 59
    //   114: astore 13
    //   116: aload_3
    //   117: monitorexit
    //   118: aload 13
    //   120: athrow
    //   121: astore_3
    //   122: aload_3
    //   123: invokestatic 122	sudroid/LogUtils:e	(Ljava/lang/Throwable;)V
    //   126: goto -65 -> 61
    //   129: astore_3
    //   130: aload_3
    //   131: invokestatic 122	sudroid/LogUtils:e	(Ljava/lang/Throwable;)V
    //   134: goto -73 -> 61
    //
    // Exception table:
    //   from	to	target	type
    //   21	114	114	finally
    //   0	21	121	java/lang/IllegalAccessException
    //   118	121	121	java/lang/IllegalAccessException
    //   0	21	129	java/lang/InstantiationException
    //   118	121	129	java/lang/InstantiationException
  }

  public final void differenceFront(long paramLong)
  {
    try
    {
      ??? = initBackgroundDatas();
      if (prepareExtraDatas(paramLong, (Set)???));
      synchronized (this.lock)
      {
        Set localSet1 = this.backgroundDatas;
        Set localSet2 = this.frontDatas;
        boolean bool1 = localSet1.removeAll(localSet2);
        this.frontDatas.clear();
        Set localSet3 = this.frontDatas;
        Set localSet4 = this.backgroundDatas;
        boolean bool2 = localSet3.addAll(localSet4);
        Handler localHandler = this.uiHandler;
        SetAdapter.8 local8 = new SetAdapter.8(this, paramLong);
        boolean bool3 = localHandler.postAtFrontOfQueue(local8);
        return;
      }
    }
    catch (IllegalAccessException localIllegalAccessException)
    {
      while (true)
        LogUtils.e(localIllegalAccessException);
    }
    catch (InstantiationException localInstantiationException)
    {
      while (true)
        LogUtils.e(localInstantiationException);
    }
  }

  protected Context getContext()
  {
    return this.mContext;
  }

  public int getCount()
  {
    synchronized (this.lock)
    {
      int i = getCountWrapper();
      return i;
    }
  }

  protected abstract int getCountWrapper();

  public T getFromFrontDatas(int paramInt)
  {
    synchronized (this.lock)
    {
      Iterator localIterator = this.frontDatas.iterator();
      int i = -1;
      if (!localIterator.hasNext());
      Comparable localComparable;
      for (??? = null; ; ??? = localComparable)
      {
        return ???;
        i += 1;
        if (i != paramInt)
          break;
        localComparable = (Comparable)localIterator.next();
      }
      Object localObject2 = localIterator.next();
    }
  }

  public int getFrontDatasSize()
  {
    synchronized (this.lock)
    {
      int i = this.frontDatas.size();
      return i;
    }
  }

  protected Handler getHandler()
  {
    return this.uiHandler;
  }

  public final Object getItem(int paramInt)
  {
    synchronized (this.lock)
    {
      Object localObject2 = getItemWrapper(paramInt);
      return localObject2;
    }
  }

  public final long getItemId(int paramInt)
  {
    synchronized (this.lock)
    {
      long l = getItemIdWrapper(paramInt);
      return l;
    }
  }

  protected abstract long getItemIdWrapper(int paramInt);

  protected abstract Object getItemWrapper(int paramInt);

  public final View getView(int paramInt, View paramView, ViewGroup paramViewGroup)
  {
    synchronized (this.lock)
    {
      View localView = getViewWrapper(paramInt, paramView);
      return localView;
    }
  }

  protected abstract View getViewWrapper(int paramInt, View paramView);

  protected final Set<T> initBackgroundDatas()
    throws IllegalAccessException, InstantiationException
  {
    if (this.backgroundDatas == null)
    {
      Set localSet = (Set)this.mClass.newInstance();
      this.backgroundDatas = localSet;
    }
    while (true)
    {
      return this.backgroundDatas;
      this.backgroundDatas.clear();
    }
  }

  // ERROR //
  public final void intersection(long paramLong)
  {
    // Byte code:
    //   0: aload_0
    //   1: invokevirtual 89	sudroid/android/context/SetAdapter:initBackgroundDatas	()Ljava/util/Set;
    //   4: astore_3
    //   5: aload_0
    //   6: lload_1
    //   7: aload_3
    //   8: invokevirtual 93	sudroid/android/context/SetAdapter:prepareExtraDatas	(JLjava/util/Set;)Z
    //   11: ifeq +62 -> 73
    //   14: aload_0
    //   15: getfield 43	sudroid/android/context/SetAdapter:lock	Ljava/lang/Object;
    //   18: astore_3
    //   19: aload_3
    //   20: monitorenter
    //   21: aload_0
    //   22: getfield 76	sudroid/android/context/SetAdapter:backgroundDatas	Ljava/util/Set;
    //   25: astore 4
    //   27: aload_0
    //   28: getfield 70	sudroid/android/context/SetAdapter:frontDatas	Ljava/util/Set;
    //   31: astore 5
    //   33: aload 4
    //   35: aload 5
    //   37: invokeinterface 186 2 0
    //   42: ifeq +32 -> 74
    //   45: aload_0
    //   46: getfield 58	sudroid/android/context/SetAdapter:uiHandler	Landroid/os/Handler;
    //   49: astore 6
    //   51: new 188	sudroid/android/context/SetAdapter$4
    //   54: dup
    //   55: aload_0
    //   56: lload_1
    //   57: invokespecial 189	sudroid/android/context/SetAdapter$4:<init>	(Lsudroid/android/context/SetAdapter;J)V
    //   60: astore 7
    //   62: aload 6
    //   64: aload 7
    //   66: invokevirtual 106	android/os/Handler:postAtFrontOfQueue	(Ljava/lang/Runnable;)Z
    //   69: istore 8
    //   71: aload_3
    //   72: monitorexit
    //   73: return
    //   74: aload_0
    //   75: getfield 70	sudroid/android/context/SetAdapter:frontDatas	Ljava/util/Set;
    //   78: astore 9
    //   80: aload_0
    //   81: getfield 76	sudroid/android/context/SetAdapter:backgroundDatas	Ljava/util/Set;
    //   84: astore 10
    //   86: aload 9
    //   88: aload 10
    //   90: invokeinterface 192 2 0
    //   95: istore 11
    //   97: aload_0
    //   98: getfield 58	sudroid/android/context/SetAdapter:uiHandler	Landroid/os/Handler;
    //   101: astore 12
    //   103: new 194	sudroid/android/context/SetAdapter$5
    //   106: dup
    //   107: aload_0
    //   108: lload_1
    //   109: invokespecial 195	sudroid/android/context/SetAdapter$5:<init>	(Lsudroid/android/context/SetAdapter;J)V
    //   112: astore 13
    //   114: aload 12
    //   116: aload 13
    //   118: invokevirtual 106	android/os/Handler:postAtFrontOfQueue	(Ljava/lang/Runnable;)Z
    //   121: istore 14
    //   123: goto -52 -> 71
    //   126: astore 15
    //   128: aload_3
    //   129: monitorexit
    //   130: aload 15
    //   132: athrow
    //   133: astore_3
    //   134: aload_3
    //   135: invokestatic 122	sudroid/LogUtils:e	(Ljava/lang/Throwable;)V
    //   138: goto -65 -> 73
    //   141: astore_3
    //   142: aload_3
    //   143: invokestatic 122	sudroid/LogUtils:e	(Ljava/lang/Throwable;)V
    //   146: goto -73 -> 73
    //
    // Exception table:
    //   from	to	target	type
    //   21	126	126	finally
    //   0	21	133	java/lang/IllegalAccessException
    //   130	133	133	java/lang/IllegalAccessException
    //   0	21	141	java/lang/InstantiationException
    //   130	133	141	java/lang/InstantiationException
  }

  public final void notifyDataSetChanged()
  {
    synchronized (this.lock)
    {
      super.notifyDataSetChanged();
      return;
    }
  }

  public final void notifyDataSetInvalidated()
  {
    synchronized (this.lock)
    {
      super.notifyDataSetInvalidated();
      return;
    }
  }

  protected abstract void onDataChanged(long paramLong);

  protected abstract void onDataNotChange(long paramLong);

  protected abstract boolean prepareExtraDatas(long paramLong, Set<T> paramSet);

  public final void unionBackground(long paramLong)
  {
    new SetAdapter.1(this, paramLong).start();
  }

  // ERROR //
  public final void unionFront(long paramLong)
  {
    // Byte code:
    //   0: aload_0
    //   1: invokevirtual 89	sudroid/android/context/SetAdapter:initBackgroundDatas	()Ljava/util/Set;
    //   4: astore_3
    //   5: aload_0
    //   6: lload_1
    //   7: aload_3
    //   8: invokevirtual 93	sudroid/android/context/SetAdapter:prepareExtraDatas	(JLjava/util/Set;)Z
    //   11: ifeq +74 -> 85
    //   14: aload_0
    //   15: getfield 43	sudroid/android/context/SetAdapter:lock	Ljava/lang/Object;
    //   18: astore_3
    //   19: aload_3
    //   20: monitorenter
    //   21: aload_0
    //   22: getfield 76	sudroid/android/context/SetAdapter:backgroundDatas	Ljava/util/Set;
    //   25: invokeinterface 97 1 0
    //   30: ifle +27 -> 57
    //   33: aload_0
    //   34: getfield 70	sudroid/android/context/SetAdapter:frontDatas	Ljava/util/Set;
    //   37: astore 4
    //   39: aload_0
    //   40: getfield 76	sudroid/android/context/SetAdapter:backgroundDatas	Ljava/util/Set;
    //   43: astore 5
    //   45: aload 4
    //   47: aload 5
    //   49: invokeinterface 186 2 0
    //   54: ifeq +32 -> 86
    //   57: aload_0
    //   58: getfield 58	sudroid/android/context/SetAdapter:uiHandler	Landroid/os/Handler;
    //   61: astore 6
    //   63: new 213	sudroid/android/context/SetAdapter$2
    //   66: dup
    //   67: aload_0
    //   68: lload_1
    //   69: invokespecial 214	sudroid/android/context/SetAdapter$2:<init>	(Lsudroid/android/context/SetAdapter;J)V
    //   72: astore 7
    //   74: aload 6
    //   76: aload 7
    //   78: invokevirtual 106	android/os/Handler:postAtFrontOfQueue	(Ljava/lang/Runnable;)Z
    //   81: istore 8
    //   83: aload_3
    //   84: monitorexit
    //   85: return
    //   86: aload_0
    //   87: getfield 76	sudroid/android/context/SetAdapter:backgroundDatas	Ljava/util/Set;
    //   90: astore 9
    //   92: aload_0
    //   93: getfield 70	sudroid/android/context/SetAdapter:frontDatas	Ljava/util/Set;
    //   96: astore 10
    //   98: aload 9
    //   100: aload 10
    //   102: invokeinterface 130 2 0
    //   107: istore 11
    //   109: aload_0
    //   110: getfield 76	sudroid/android/context/SetAdapter:backgroundDatas	Ljava/util/Set;
    //   113: astore 12
    //   115: aload_0
    //   116: getfield 70	sudroid/android/context/SetAdapter:frontDatas	Ljava/util/Set;
    //   119: astore 13
    //   121: aload 12
    //   123: aload 13
    //   125: invokeinterface 137 2 0
    //   130: istore 14
    //   132: aload_0
    //   133: getfield 70	sudroid/android/context/SetAdapter:frontDatas	Ljava/util/Set;
    //   136: invokeinterface 83 1 0
    //   141: aload_0
    //   142: getfield 70	sudroid/android/context/SetAdapter:frontDatas	Ljava/util/Set;
    //   145: astore 15
    //   147: aload_0
    //   148: getfield 76	sudroid/android/context/SetAdapter:backgroundDatas	Ljava/util/Set;
    //   151: astore 16
    //   153: aload 15
    //   155: aload 16
    //   157: invokeinterface 137 2 0
    //   162: istore 17
    //   164: aload_0
    //   165: getfield 58	sudroid/android/context/SetAdapter:uiHandler	Landroid/os/Handler;
    //   168: astore 18
    //   170: new 216	sudroid/android/context/SetAdapter$3
    //   173: dup
    //   174: aload_0
    //   175: lload_1
    //   176: invokespecial 217	sudroid/android/context/SetAdapter$3:<init>	(Lsudroid/android/context/SetAdapter;J)V
    //   179: astore 19
    //   181: aload 18
    //   183: aload 19
    //   185: invokevirtual 106	android/os/Handler:postAtFrontOfQueue	(Ljava/lang/Runnable;)Z
    //   188: istore 20
    //   190: goto -107 -> 83
    //   193: astore 21
    //   195: aload_3
    //   196: monitorexit
    //   197: aload 21
    //   199: athrow
    //   200: astore_3
    //   201: aload_3
    //   202: invokestatic 122	sudroid/LogUtils:e	(Ljava/lang/Throwable;)V
    //   205: goto -120 -> 85
    //   208: astore_3
    //   209: aload_3
    //   210: invokestatic 122	sudroid/LogUtils:e	(Ljava/lang/Throwable;)V
    //   213: goto -128 -> 85
    //
    // Exception table:
    //   from	to	target	type
    //   21	193	193	finally
    //   0	21	200	java/lang/IllegalAccessException
    //   197	200	200	java/lang/IllegalAccessException
    //   0	21	208	java/lang/InstantiationException
    //   197	200	208	java/lang/InstantiationException
  }
}

/* Location:           D:\Program Files\eclipse\apktool-r01-3\新浪微博\classes.dex.dex2jar.jar
 * Qualified Name:     sudroid.android.context.SetAdapter
 * JD-Core Version:    0.6.0
 */